﻿using PowerBooking.RSE.Poco;
using PowerBooking.RSE.Repository;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;

namespace PowerBooking.RSE.Domain.Models
{
    /// <summary>
    /// 蜘蛛聚合根
    /// </summary>
    public class Spider
    {
        /// <summary>
        /// 蜘蛛ID
        /// </summary>
        public int SpiderID { get { return spiderPoco.SpiderID; } }

        /// <summary>
        /// Url
        /// </summary>
        public string Url { get { return spiderPoco.Url; } }

        /// <summary>
        /// 城市列表
        /// </summary>
        public List<City> Cities { get; private set; }

        private SpiderPoco spiderPoco;

        /// <summary>
        /// 初始化领域对象
        /// </summary>
        /// <returns></returns>
        internal Spider InitDomain(SpiderPoco spiderPoco)
        {
            this.spiderPoco = spiderPoco;
            return this;
        }

        internal Spider InitCities(List<City> cities)
        {
            Cities = cities;
            return this;
        }
    }
}
